<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <button>点我</button>
  <script>
    const btn = document.querySelector('button');
    btn.addEventListener('click',function (){
        alert("天气还不错")
    })
</script>
</body>
</html>